package com.liang;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

/**
 * Created with Intellij IDEA
 *
 * @Auther: liangjy
 * @Date: 2021/12/23/9:52
 * @Description: 端口 8081
 */

@SpringBootApplication
public class RestTemplateApplication {
    public static void main(String[] args)  {
        SpringApplication.run(RestTemplateApplication.class, args);
    }

    /**
     * @Description:需要注意的是，需要在启动类里将RestTemplate的实例进行注入的，这里采用@Bean的方式，
     * @return
     */
    @Bean
    public RestTemplate restTemplate(){
        return new RestTemplate();
    }
}
